@import '~/common/style/index.scss';

$callkit-header-prefix-cls: #{$cui-prefix}-callkit-header;

.#{$callkit-header-prefix-cls} {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  // background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  border-radius: 12px;
  color: white;
  min-height: 60px;
  // box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;

  // 背景装饰
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
  }

  // 左侧群组信息
  &-left {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0; // 防止文本溢出
  }

  &-group-info {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  // 头像容器
  &-avatar-container {
    position: relative;
    flex-shrink: 0;
  }

  &-avatar,
  &-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
  }

  &-avatar {
    object-fit: cover;
  }

  &-avatar-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: white;
  }

  // 参与者预览（小头像叠加）
  &-participants-preview {
    position: absolute;
    bottom: -2px;
    right: -2px;
    display: flex;
    gap: -4px; // 负间距实现叠加效果
    
    .participant-avatar {
      width: 20px;
      height: 20px;
      border-radius: 50%;
      border: 2px solid white;
      background: #ccc;
    }
  }

  // 信息区域
  &-info {
    flex: 1;
    min-width: 0;
  }

  &-group-name {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &-call-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
  }

  &-duration {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
  }

  &-participant-count {
    &::before {
      content: '•';
      margin-right: 4px;
    }
  }

  // 右侧操作区域
  &-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  &-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  // 操作按钮
  &-action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);

    &:hover {
      background: rgba(255, 255, 255, 0.25);
      transform: translateY(-1px);
    }

    &:active {
      transform: translateY(0);
      background: rgba(255, 255, 255, 0.2);
    }

    svg {
      width: 18px;
      height: 18px;
      opacity: 0.9;
    }
  }

  // 特定按钮样式
  &-fullscreen-btn {
    &:hover {
      background: rgba(74, 144, 226, 0.3);
    }
  }

  &-copy-btn {
    &:hover {
      background: rgba(52, 199, 89, 0.3);
    }
  }

  &-users-btn {
    &:hover {
      background: rgba(255, 149, 0, 0.3);
    }
  }

  &-more-btn {
    &:hover {
      background: rgba(255, 255, 255, 0.25);
    }
  }
}

// 响应式设计
@media (max-width: 768px) {
  .#{$callkit-header-prefix-cls} {
    padding: 8px 12px;
    min-height: 56px;

    &-avatar,
    &-avatar-placeholder {
      width: 40px;
      height: 40px;
    }

    &-avatar-placeholder {
      font-size: 16px;
    }

    &-group-name {
      font-size: 14px;
    }

    &-call-info {
      font-size: 11px;
    }

    &-action-btn {
      width: 32px;
      height: 32px;

      svg {
        width: 16px;
        height: 16px;
      }
    }

    &-actions {
      gap: 6px;
    }
  }
}

@media (max-width: 480px) {
  .#{$callkit-header-prefix-cls} {
    &-participant-count {
      display: none; // 在小屏幕上隐藏参与者数量
    }

    &-actions {
      gap: 4px;
    }

    &-action-btn {
      width: 28px;
      height: 28px;

      svg {
        width: 14px;
        height: 14px;
      }
    }
  }
} 